--CREATE DATABASE Examenes
--GO

USE [Examenes]
GO
/****** Object:  Table [dbo].[Calendarizacion]    Script Date: 28/09/2014 10:50:12 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[Calendarizacion](
	[IdCalendarizacion] [int] IDENTITY(1,1) NOT NULL,
	[IdCuestionario] [int] NOT NULL,
	[Fecha] [datetime] NOT NULL,
	[TiempoExamen] [int] NOT NULL,
	[FechaCierre] [datetime] NOT NULL,
	[Intentos] [int] NOT NULL,
	[Descripcion] [varchar](300) NOT NULL,
	[Estado] [varchar](20) NOT NULL,
	[IdCurso] [int] NOT NULL,
 CONSTRAINT [PK_Calendarizacion] PRIMARY KEY CLUSTERED 
(
	[IdCalendarizacion] ASC,
	[IdCuestionario] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]

GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [dbo].[Examen]    Script Date: 28/09/2014 10:50:12 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[Examen](
	[IdExamen] [int] IDENTITY(1,1) NOT NULL,
	[IdCalendarizacion] [int] NOT NULL,
	[IdCuestionario] [int] NOT NULL,
	[IdEstudiante] [int] NOT NULL,
	[Fecha] [datetime] NOT NULL,
	[Tiempo] [int] NOT NULL,
	[TiempoTranscurrido] [int] NOT NULL,
	[Nota] [decimal](18, 0) NOT NULL,
	[NumeroIntentos] [int] NOT NULL,
	[Estado] [varchar](20) NOT NULL,
 CONSTRAINT [PK_Examen] PRIMARY KEY CLUSTERED 
(
	[IdExamen] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]

GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [dbo].[RespuestaExamen]    Script Date: 28/09/2014 10:50:12 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[RespuestaExamen](
	[IdRespuestaExamen] [int] IDENTITY(1,1) NOT NULL,
	[IdExamen] [int] NOT NULL,
	[IdPregunta] [int] NOT NULL,
	[IdOpcion] [int] NOT NULL,
	[Calificacion] [decimal](18, 0) NOT NULL,
 CONSTRAINT [PK_RespuestaExamen] PRIMARY KEY CLUSTERED 
(
	[IdRespuestaExamen] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
